// TOWN DIALOGUE SCRIPT
//    Town 133: Softport

begintalkscript;

variables;

short i,j,k,r1,choice;

// Mayor Scowcroft

begintalknode;
	tag = 40;
	state = -1;
	nextstate = 1;
	question = "Mayor Scowcroft";
	text1 = "The mayor of Softport seems pleased to see you, despite all the pressure he has been under.";
	text2 = "_I'm Mayor Scowcroft. Welcome to you! Non-evil warriors are always welcome._";
	text5 = "The constant monster attacks in Valorim have caused the leaders to have a constant worried and edgy expression. The mayor is still willing to speak with you.";
	action = INTRO;

begintalknode;
	state = 1;
	nextstate = 2;
	question = "_How goes your career, Mayor?_";
	text1 = "_Oh, I just try to deal with all the monsters as best I can. I haven't been nearly as effective as you, though._";

begintalknode;
	state = 2;
	nextstate = 3;
	question = "_How did you learn about me?_";
	text1 = "He looks you over, impressed. _Oh, the tales of the traveling Avernite have gotten around pretty quick!_ He thinks. _Wait. It isn't a secret you're an Avernite, is it? Am I supposed to know?_";

begintalknode;
	state = 3;
	nextstate = 4;
	question = "_I guess it is no secret anymore._";
	text1 = "He leans close. _I sure don't want to mess around with you, being as you're famous and brave and all. But I'd love to help you if I could._";

begintalknode;
	state = 4;
	nextstate = -1;
	question = "_I'll accept your help._";
	text1 = "He leans close. _Be sure to search my books and help yourself to anything you find._ He grins conspiratorially.";

begintalknode;
	state = 3;
	nextstate = -1;
	question = "_Ummm .. You know about me. I should be going now. Bye._";
	text1 = "The mayor knows all about your Secret Identity. You get away from him quickly before you get into any trouble.";
	action = END_TALK;

begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(133,4) <= 1 && get_prestige() < 10;
	question = "_I could use employment. Do you need any assistance?_";
	text1 = "He shakes his head. _There is a problem here. However, I can't ask just anyone passing through to help. I just don't know you. My apologies._";

begintalknode;
	state = 1;
	nextstate = 5;
	condition = gf(133,4) <= 1 && get_prestige() >= 10;
	question = "_I could use employment. Do you need any assistance?_";
	text1 = "_Well, normally, the Empire would help us with this. However, they will not, as Valorim is under quarantine. So I must ask adventurers, such as yourselves. Recently a man, going by the name of Zik, passed through our town._";
	text2 = "_Alas, during his brief stay, he killed someone. So he must be brought to justice. Fatally, if necessary. I have no idea where he went, but he has a tattoo of a sun on the back of his right hand._";
	action = SET_SDF 133 4 1;
	code =
		toggle_quest(45,1);
	break;

begintalknode;
	state = 5;
	nextstate = -1;
	question = "_No idea where Zik went?_";
	text1 = "_When he ran out of town, he was heading north. Of course, he could have gone anywhere from there._";
	
begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(133,4) == 1 && gf(156,11) >= 1;
	question = "_I have done it. Zik is dead._";
	code =
		run_hardcode(27);
	break;

// Terry

begintalknode;
	tag = 60;
	state = -1;
	nextstate = 29;
	question = "Terry";
	text1 = "A wiry man paces back and forth by the docks, selling ferry tickets. _I'm Terry._ He scratches himself.";
	text5 = "Terry paces back and forth by the docks, selling ferry tickets.";
	action = INTRO;

begintalknode;
	state = 29;
	nextstate = 30;
	question = "_What are you selling?_";
	text1 = "_Well, I have tickets for sale. To Fenris Port. On the Isle of Bigail. Only ten coins._";

begintalknode;
	state = 29;
	nextstate = -1;
	condition = coins_amount() >= 10;
	question = "_I'll take some tickets._ Pay ten coins.";
	text1 = "He tears you each off a grimy ticket. _Go to the end of the docks. I'm sure you'll find a place to use the tickets somewhere._";
	text5 = "You have already bought this.";
	code =
		cs();
		if (gf(133,9) > 0)
			as(5);
			else {
				sf(133,9,1);
				change_coins(-10);
				as(1);
				}
	break;

begintalknode;
	state = 30;
	nextstate = 31;
	question = "_What's Fenris Port like?_";
	text1 = "He laughs, coughs, and spits into the water. _Fenris Port! Great town! Lots of scum there!_";

begintalknode;
	state = 31;
	nextstate = 32;
	question = "_Friendly scum, I hope._";
	text1 = "_Yeah!_ He pulls a begging bowl out from behind his back. _Only five coins, and I'll give you a little information._";

begintalknode;
	state = 32;
	nextstate = 33;
	condition = coins_amount() >= 5;
	question = "Give 5 coins. _All right, what's the information?_";
	text1 = "He hawks and spits an impressive, tobacco-tinted stream into the water. _The good folks on the Isle of Bigail make certain herbs valuable in Lorelei. Be sure to look about. Also, for only 100 coins more, I'll tell you another secret._";
	code =
		change_coins(-5);
	break;

begintalknode;
	state = 32;
	nextstate = -1;
	question = "_Not interested._";
	text1 = "_Fine. I'll be here if you want a ferry ticket._";
	action = END_TALK;

begintalknode;
	state = 33;
	nextstate = 29;
	condition = coins_amount() >= 100;
	question = "Give 100 coins. _Quite a little side business you have going._";
	text1 = "_Thanks. The guards south of Lorelei will search anyone approaching, looking for these herbs. However, north from Lorelei there's a hidden way to cross the river and get there. Just walk along the river shore and look for some big stone spires. You'll see it._";
	code =
		change_coins(-100);
	break;

begintalknode;
	state = 33;
	nextstate = -1;
	question = "_Not interested._";
	text1 = "_Fine. I'll be here if you want a ferry ticket._";
	action = END_TALK;
	
begintalknode;
	state = 29;
	nextstate = -1;
	condition = 1;
	question = "_I don't need any tickets._";
	text1 = "_Oh. Fine._";
	action = END_TALK;

// Nydia

begintalknode;
	tag = 80;
	state = -1;
	nextstate = 57;
	question = "Nydia";
	text1 = "You meet a priestess. She's counting several piles of gold on top of the altar. When you approach, she scoops it all into a pouch. _I'm Nydia. Welcome to this temple! Please don't get mud on the rugs._";
	text2 = "_You are in luck. Blessings are on sale. Only five coins._";
	text5 = "Nydia speaks with you. You notice that she constantly keeps her hand on her coin pouch. She is eager to return to counting the temple money.";
	action = INTRO;

begintalknode;
	state = 57;
	nextstate = 58;
	question = "_This is a fine temple._";
	text1 = "_Yes. I'm a Priestess of the Church of the Divine Lucre. We sell salvation at reasonable rates._";

begintalknode;
	state = 58;
	nextstate = 59;
	question = "_What does the Church of the Divine Lucre stand for?_";
	text1 = "_We are a beautiful organization. After all, the only way to help others is to help oneself. Self-reliance will lift us all up. Wealth is the great salvation. And we grant absolution for very reasonable rates._";

begintalknode;
	state = 59;
	nextstate = 60;
	question = "_So how much does absolution run for these days?_";
	text1 = "_Actually, I am not yet authorized to grant absolution. Haven't saved up enough to buy the ability._";

begintalknode;
	state = 60;
	nextstate = -1;
	question = "_You can't absolve me at least a little?_";
	text1 = "_Well I could informally, but without payment, I can't provide proper and authorized salvation._";

begintalknode;
	state = 57;
	nextstate = -1;
	question = "_I'd like to learn spells._";
	text1 = "_What? You mean, like true rituals of power? I can't do any of those. I wish I could! Teaching them would be amazingly profitable!_";

begintalknode;
	state = 57;
	nextstate = 61;
	condition = gf(8,11) >= 1;
	question = "_I heard that you might know the Ritual of Sanctification?_";
	text1 = "She looks suspicious. _Who told you to ask me about that?_";

begintalknode;
	state = 61;
	nextstate = -1;
	question = "_Corie told me to speak with you._";
	text1 = "She gets upset. You can't imagine why. _Her. I told her I didn't want anything to do ..._ She pauses to regain her composure. _Oh. Yes. Look, I'd love to teach it to you for a fee, but I don't know it. I know who does, though._";
	text2 = "_There's a hermit in a hut at the north end of the mountains to the north. He knows the spell. I can't get it out of him, but you might be able to. Now go away, please._ Highly agitated, she turns away.";
	action = END_TALK;
	code =
		//run_hardcode(29);
		sf(133,11,1);
	break;
	
begintalknode;
	state = 57;
	nextstate = -1;
	condition = coins_amount() >= 5;
	question = "_I want a blessing._ Pay five coins.";
	text1 = "She takes your money, waves her hands over you, and mutters a few words. _There. You have a partial blessing. Of course, for more payment, I can augment the blessing. Can you afford to do without it?_";
	action = REUSABLE;
	code =
		change_coins(-5);
	break;
	
begintalknode;
	state = 57;
	nextstate = -1;
	condition = 1;
	question = "_I don't need a blessing._";
	text1 = "_That's all right. You might survive without it._";
	action = END_TALK;


//KELLY ADD

// Tucker

begintalknode;
	tag = 140;
	state = -1;
	nextstate = 150;
	question = "Tucker";
	text1 = "At first, the shadows of the room make it hard to tell for sure. Then, when you look closer, you see that your first impression was right. This pale man is an Avernite!";
	text2 = "He has a nasty leg wound, which has been bandaged. When he gets a good look at you, he whispers, _Greetings. I'm Tucker._";
	text5 = "Tucker leans against the wall of his room. _What else do you want, friend?_";
	action = INTRO;

begintalknode;
	state = 150;
	nextstate = -1;
	condition = gf(307,13) == 0;
	question = "_You're hurt. Are you going to go back to Avernum?_";
	text1 = "_Soon. Soon, I will. First, I must tell you my story and what I have learned._";

begintalknode;
	state = 150;
	nextstate = 151;
	question = "_What are you doing up here on the surface?_";
	text1 = "_I was ... well ... I was doing what you're doing, I guess. Anaximander sent me._";
	action = SET_SDF 307 13 1;

begintalknode;
	state = 150;
	nextstate = -1;
	condition = gf(307,13) >= 1;
	question = "_You're hurt. Are you going to go back to Avernum?_";
	text1 = "_Now that I have made contact, I can. Good luck to you. Now, I have a long painful walk ahead of me. Then a long, long chat with Anaximander._";
	text2 = "He stands with difficulty, shakes your hand, and hobbles out of the room.";
	action = END_TALK;
	code =
		award_party_xp(100,15);
		erase_char(13315);
	break;

begintalknode;
	state = 151;
	nextstate = 152;
	question = "_And me as well._";
	text1 = "_He sent me and Erin and Elsner and Gwost. We were the first surface explorers. There was too much to explore, though, so we split up, each investigating our own area._";

begintalknode;
	state = 152;
	nextstate = -1;
	question = "_Where did the others go?_";
	text1 = "_Elsner went west to Shayder. Erin stayed in the south. Gwost went to the southeastern villages. Haven't heard from them. And I investigated the troglos. Or tried to._";

begintalknode;
	state = 152;
	nextstate = 153;
	question = "_What happened to you then?_";
	text1 = "_I was going to Sharimik. I was going to find what I could about the troglos. But they ambushed me. I barely escaped with my life and a javelin wound on my leg._";
	text2 = "_I was just waiting here until more spies came, so I could tell them what I know. Then I will head back to Avernum._";

begintalknode;
	state = 153;
	nextstate = -1;
	question = "_What do you know?_";
	text1 = "_If you can get into Sharimik, go see Mayor Knight. He has been looking for people to do some mission regarding the troglodytes. If you are trying to find out more about these creatures, that is the natural place to begin._";
	text3 = "_If you can get into Sharimik, go see Mayor Knight. He has been looking for people to do some mission regarding the troglodytes._";
	text4 = "He is pleased when he finds out you have already contacted Mayor Knight. _Then I can go home with a clear conscience._";
	action = DEP_ON_SDF 10 0 1;

